package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-07-27
 * Time: 13:18
 */
public class test9 {

    public static void main(String[] args) throws InterruptedException {
       Thread t = new Thread(()->{
           //Thread.currentThread().isInterrupted() 默认为false
           while(!Thread.currentThread().isInterrupted()){
               System.out.println("正在运行中...");
           }
       });

       t.start();
       t.interrupt();
       System.out.println("线程结束!!!");
    }


}
